home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / gfxprograms / 3dprograms / rayshade-4.0 / fixes / fix012 < prev    next >
Internet Message Format  |  1995-02-13  |  6KB

  1. From theseas!fs.Princeton.EDU!cek Mon, 28 Jun 93 01:31:16 EET
  2. Received: by kriton.UUCP (V1.16/Amiga)
  3.     id AA00000; Mon, 28 Jun 93 01:31:16 EET
  4. Received: by theseas.ntua.gr with UUCP; Sat, 26 Jun 93 17:36:52 +0300
  5. Received: from mcsun.EU.net by pythia.ics.forth.gr via ITEnet with SMTP;
  6.     id AA07690 (5.65c/FORTH-ICS-3.0-MHS-7.0); Sat, 26 Jun 1993 01:18:02 +0300
  7. Received: by mcsun.EU.net via EUnet
  8.     id AA22882 (5.65b/CWI-2.226); Sat, 26 Jun 1993 00:17:50 +0200
  9. Received: from Princeton.EDU by relay2.UU.NET with SMTP 
  10.     (5.61/UUNET-internet-primary) id AA28262; Fri, 25 Jun 93 18:16:45 -0400
  11. Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.96/princeton)
  12.     id AA29672; Fri, 25 Jun 93 15:03:21 -0400
  13. Received: by fs.Princeton.EDU (4.1/1.105)
  14.     id AA10836; Fri, 25 Jun 93 15:03:18 EDT
  15. Received: from faui45.informatik.uni-erlangen.de ([131.188.34.45]) by fs.Princeton.EDU (4.1/1.105)
  16.     id AA10746; Fri, 25 Jun 93 15:02:31 EDT
  17. Received: from faui43.informatik.uni-erlangen.de by uni-erlangen.de with SMTP;
  18.     id AA24455 (5.65c-5/7.3u-FAU); Fri, 25 Jun 1993 21:02:12 +0200
  19. Received: by immd4.informatik.uni-erlangen.de;
  20.     id AA06410 (5.65c-5/7.3m-FAU); Fri, 25 Jun 1993 21:02:10 +0200
  21. Message-Id: <199306251902.AA06410@faui43.informatik.uni-erlangen.de>
  22. Date: Fri, 25 Jun 93 21:02:10 METDST
  23. X-Mailer: ELM [version 2.3 PL11]
  24. Errors-To: Princeton.EDU!cek
  25. Remailed-Date: Fri Jun 25 15:02:36 EDT 1993
  26. From: "Michael Schroeder (Inf4 - hiwi)" <immd4.informatik.uni-erlangen.de!mlschroe>
  27. To: "Rayshade Distribution List" <cs.Princeton.EDU!rayshade-users>
  28. Subject: Translucency bugs
  29.  
  30.  
  31. Hello Rayshade users,
  32.  
  33. the following mail was originally sent to Craig, but no response
  34. up to now. I think he has an overfull mailbox again... :-)
  35.  
  36. Michael.
  37.  
  38. ==================================================================
  39.  
  40. Hello Craig,
  41.  
  42. some things I noticed in the translucency implementation:
  43.  
  44. 1) After the translucency is added, the color vector is scaled. This
  45.    is not a good thing, because all the contributions of the other
  46.    light sources are scaled, too. A solution is to scale the calculated
  47.    intensity of the light (i.e. lcolor) before calling Lighting().
  48.  
  49. 2) I don't think that the calculation of cosalpha is correct. In the
  50.    current implementation the angle between the reflected ray and the
  51.    light ray is used. Shouldn't that be the angle between the original
  52.    ray and the light ray?
  53.  
  54. What do you think?
  55.   Michael
  56.  
  57. ---------------------------------------------------------------
  58. Michael Schroeder    mlschroe@faui43.informatik.uni-erlangen.de
  59. main(a){while(a=~getchar())putchar(~a-1/(~(a|32)/13*2-11)*13);}
  60.  
  61. *** shade.c.orig    Tue Apr  6 17:45:17 1993
  62. --- shade.c    Mon Apr 26 13:45:18 1993
  63. ***************
  64. *** 118,125 ****
  65.        * Calculate intensity contributed by each light source.
  66.        */
  67.       for (lp = Lights; lp; lp = lp->next)
  68. !         LightRay(lp, pos, nrm, gnrm, smooth, &refl, surf,
  69. !                 ray->depth, ray->sample, ray->time, color);
  70.   
  71.       if (ray->depth >= Options.maxdepth)
  72.           /*
  73. --- 118,124 ----
  74.        * Calculate intensity contributed by each light source.
  75.        */
  76.       for (lp = Lights; lp; lp = lp->next)
  77. !         LightRay(lp, pos, nrm, gnrm, smooth, &refl, surf, ray, color);
  78.   
  79.       if (ray->depth >= Options.maxdepth)
  80.           /*
  81. ***************
  82. *** 162,175 ****
  83.    * Lighting calculations
  84.    */
  85.   static void
  86. ! LightRay(lp, pos, norm, gnorm, smooth, reflect, surf, depth, samp, time, color)
  87.   Light *lp;            /* Light source */
  88.   Vector *pos, *norm, *gnorm;    /* hit pos, shade norm, geo norm */
  89.   int smooth;            /* true if shade and geo norm differ */
  90.   Vector *reflect;        /* reflection direction */
  91.   Surface *surf;            /* surface characteristics */
  92. ! int depth, samp;        /* ray depth, sample # */
  93. ! Float time;
  94.   Color *color;            /* resulting color */
  95.   {
  96.       Color lcolor;
  97. --- 161,173 ----
  98.    * Lighting calculations
  99.    */
  100.   static void
  101. ! LightRay(lp, pos, norm, gnorm, smooth, reflect, surf, oldray, color)
  102.   Light *lp;            /* Light source */
  103.   Vector *pos, *norm, *gnorm;    /* hit pos, shade norm, geo norm */
  104.   int smooth;            /* true if shade and geo norm differ */
  105.   Vector *reflect;        /* reflection direction */
  106.   Surface *surf;            /* surface characteristics */
  107. ! Ray *oldray;            /* indicent ray */
  108.   Color *color;            /* resulting color */
  109.   {
  110.       Color lcolor;
  111. ***************
  112. *** 177,185 ****
  113.       Float costheta, cosalpha, dist;
  114.   
  115.       newray.pos = *pos;
  116. !     newray.depth = depth;
  117. !     newray.sample = samp;
  118. !     newray.time = time; 
  119.       newray.media = (Medium *)NULL;    
  120.   
  121.       LightDirection(lp, pos, &newray.dir, &dist);
  122. --- 175,183 ----
  123.       Float costheta, cosalpha, dist;
  124.   
  125.       newray.pos = *pos;
  126. !     newray.depth = oldray->depth;
  127. !     newray.sample = oldray->sample;
  128. !     newray.time = oldray->time; 
  129.       newray.media = (Medium *)NULL;    
  130.   
  131.       LightDirection(lp, pos, &newray.dir, &dist);
  132. ***************
  133. *** 212,221 ****
  134.           if (!LightIntens(lp, &newray, dist,
  135.               (int)surf->noshadow, &lcolor))
  136.               return;
  137. !         cosalpha = -dotp(reflect, &newray.dir);
  138.           Lighting(-costheta, cosalpha, &lcolor, &surf->translu,
  139.                   &surf->body, surf->stexp, color);
  140. -         ColorScale(surf->translucency, *color, color);
  141.       } else {
  142.           if (!LightIntens(lp, &newray, dist,
  143.               (int)surf->noshadow, &lcolor))
  144. --- 210,219 ----
  145.           if (!LightIntens(lp, &newray, dist,
  146.               (int)surf->noshadow, &lcolor))
  147.               return;
  148. !         cosalpha = dotp(&oldray->dir, &newray.dir);
  149. !         ColorScale(surf->translucency, lcolor, &lcolor);
  150.           Lighting(-costheta, cosalpha, &lcolor, &surf->translu,
  151.                   &surf->body, surf->stexp, color);
  152.       } else {
  153.           if (!LightIntens(lp, &newray, dist,
  154.               (int)surf->noshadow, &lcolor))
  155.  
  156. ----------
  157. Administrivia: rayshade-request@cs.princeton.edu
  158. Mailing list: rayshade-users@cs.princeton.edu
  159.  
  160.